
#ifndef ODriveEnums_h
#define ODriveEnums_h

/* TODO: This file is dangerous because the enums could potentially change between API versions. Should transmit as part of the JSON.
** To regenerate this file, nagivate to the top level of the ODrive repository and run:
** python Firmware/interface_generator_stub.py --definitions Firmware/odrive-interface.yaml --template tools/arduino_enums_template.j2 --output Arduino/ODriveArduino/ODriveEnums.h
*/

[%- for _, enum in value_types.items() %]
[%- if enum.is_enum %]

// [[enum.fullname]]
enum [[(enum.parent.name if enum.name in ['Error', 'Mode'] else '') + enum.name ]] {
    [%- for k, value in enum['values'].items() %]
    [[((((enum.parent.name if enum.name in ['Error', 'Mode'] else '') + enum.name) | to_macro_case) + "_" + (k | to_macro_case)).ljust(40)]] = [% if enum.is_flags %]0x[['%08x' | format(value.value)]][% else %][[value.value]][% endif %],
    [%- endfor %]
};
[%- endif %]
[%- endfor %]

#endif

